apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}-mongo-ue-import
  labels:
    epc-mode: mongo-ue-import
spec:
  selector:
    matchLabels:
      app: mongo-ue-import
  template:
    metadata:
      labels:
        app: mongo-ue-import
    spec:
      containers:      
      - name: mongo
        image: free5gmano/nextepc-mongodb
        command: ["/bin/sh", "-c"]
        args:
        - mongo mongodb://{{ .Release.Name }}-mongodb-svc/open5gs /tmp/account.js;
          apt-get update;apt-get install wget -y;
          bash -x /tmp/ue-init.sh;
          sleep infinity
        volumeMounts:
        - name: account-config
          mountPath: /tmp/account.js
          subPath: "account.js"
        - name: init-script
          mountPath: /tmp/ue-init.sh
          subPath: "ue-init.sh"              
      volumes:
        - name: account-config
          configMap:
            name: {{ .Release.Name }}-open5gs-web-profile
        - name: init-script
          configMap:
            name: {{ .Release.Name }}-mongo-ue-init
